<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<title>hr-m-s</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/style.css" >
</head>
<body>
<form name="parent_menu_add" method="post" action="parentMenu!update">
	<table width="800" border="1" cellpadding="0" cellspacing="0" align="center">
	  <tr>
		<th colspan="3" scope="col">修改一级菜单</th>
	  </tr>
	  <tr>
		<td width="150">菜单名称</td>
		<td width="450"><input id="parentMenuName" name="parentMenuName" type="text" size="50" maxlength="50" value='<s:property value="parentMenu.parentMenuName"/>'/></td>
		<td width="200">一级菜单名字</td>
	  </tr>
	  <tr>
		<td>图标地址</td>
		<td><input id="parentMenuIcon" name="parentMenuIcon" type="text" size="50" maxlength="1024" value='<s:property value="parentMenu.parentMenuIcon"/>'/></td>
		<td>菜单图标相对地址</td>
	  </tr>
	  <tr>
		<td>显示顺序</td>
		<td><input id="parentMenuDisplayOrder" name="parentMenuDisplayOrder" type="text" size="50" maxlength="50" value='<s:property value="parentMenu.parentMenuDisplayOrder"/>'/></td>
		<td>控制菜单的显示顺序</td>
	  </tr>
	  <tr>
		<td>是否启用</td>
		<td>
			<select id="parentMenuDisplayKey" name="parentMenuDisplayKey">
			    <s:if test="parentMenu.parentMenuDisplayKey == 1">
					<option value="1" selected="selected">启用</option>
					<option value="0" >停用</option>
				</s:if>
				<s:else>
					<option value="1">启用</option>
					<option value="0" selected="selected">停用</option>
				</s:else>			
			</select>
		</td>
		<td>显示/隐藏该菜单</td>
	  </tr>
	  <tr>
		<td colspan="3" align="center">
		  <input type="hidden" name="parentMenuID" value='<s:property value="parentMenu.parentMenuID"/>'/>
		  <input type="submit" name="Submit" value="修改" onclick="javascript:return checkForm();"/>
		  <input type="reset" name="Reset" value="重写" onclick="javascript:return confirm('确定要重新填写所有数据吗？');""/>
		</td>
	  </tr>
  </table>
</form>
</body>
<script type="text/javascript">
function checkForm(){
	var name = document.getElementById("parentMenuName");
	var icon = document.getElementById("parentMenuIcon");
	var order = document.getElementById("parentMenuDisplayOrder");
	if (name.value == ""){
		alert("请输入以及菜单名称");
		name.focus();
		return false;
	}
}
</script>
</html>
